package o;

import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Build.VERSION;
import android.util.Log;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewParent;
import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.ItemAnimator;
import androidx.recyclerview.widget.RecyclerView.f;
import androidx.recyclerview.widget.RecyclerView.g;
import androidx.recyclerview.widget.RecyclerView.h;
import androidx.recyclerview.widget.RecyclerView.j;
import androidx.recyclerview.widget.RecyclerView.s;
import androidx.recyclerview.widget.RecyclerView.t;
import java.util.ArrayList;
import java.util.List;

public class mi extends f implements h {
    @NonNull
    d ʻ;
    private float ʻॱ;
    int ʼ = -1;
    private List<s> ʼॱ;
    float ʽ;
    private List<Integer> ʽॱ;
    private float ʾ;
    private int ʿ;
    private int ˈ = 0;
    private long ˉ;
    float ˊ;
    private e ˊˊ;
    private Rect ˊˋ;
    int ˊॱ = -1;
    private final g ˊᐝ = new g(this) {
        final /* synthetic */ mi ॱ;

        {
            this.ॱ = r1;
        }

        public boolean ˋ(@NonNull RecyclerView recyclerView, @NonNull MotionEvent motionEvent) {
            this.ॱ.ॱᐝ.ॱ(motionEvent);
            int actionMasked = motionEvent.getActionMasked();
            if (actionMasked == 0) {
                this.ॱ.ʼ = motionEvent.getPointerId(0);
                this.ॱ.ˊ = motionEvent.getX();
                this.ॱ.ˏ = motionEvent.getY();
                this.ॱ.ˎ();
                if (this.ॱ.ˋ == null) {
                    a ˏ = this.ॱ.ˏ(motionEvent);
                    if (ˏ != null) {
                        mi miVar = this.ॱ;
                        miVar.ˊ -= ˏ.ˋॱ;
                        miVar = this.ॱ;
                        miVar.ˏ -= ˏ.ˏॱ;
                        this.ॱ.ˋ(ˏ.ʼ, true);
                        if (this.ॱ.ˎ.remove(ˏ.ʼ.ˊ)) {
                            this.ॱ.ʻ.ˊ(this.ॱ.ˏॱ, ˏ.ʼ);
                        }
                        this.ॱ.ˋ(ˏ.ʼ, ˏ.ॱॱ);
                        this.ॱ.ˋ(motionEvent, this.ॱ.ᐝ, 0);
                    }
                }
            } else if (actionMasked == 3 || actionMasked == 1) {
                this.ॱ.ʼ = -1;
                this.ॱ.ˋ(null, 0);
            } else if (this.ॱ.ʼ != -1) {
                int findPointerIndex = motionEvent.findPointerIndex(this.ॱ.ʼ);
                if (findPointerIndex >= 0) {
                    this.ॱ.ˎ(actionMasked, motionEvent, findPointerIndex);
                }
            }
            if (this.ॱ.ͺ != null) {
                this.ॱ.ͺ.addMovement(motionEvent);
            }
            if (this.ॱ.ˋ != null) {
                return true;
            }
            return false;
        }

        public void ॱ(@NonNull RecyclerView recyclerView, @NonNull MotionEvent motionEvent) {
            int i = 0;
            this.ॱ.ॱᐝ.ॱ(motionEvent);
            if (this.ॱ.ͺ != null) {
                this.ॱ.ͺ.addMovement(motionEvent);
            }
            if (this.ॱ.ʼ != -1) {
                int actionMasked = motionEvent.getActionMasked();
                int findPointerIndex = motionEvent.findPointerIndex(this.ॱ.ʼ);
                if (findPointerIndex >= 0) {
                    this.ॱ.ˎ(actionMasked, motionEvent, findPointerIndex);
                }
                s sVar = this.ॱ.ˋ;
                if (sVar != null) {
                    switch (actionMasked) {
                        case 1:
                            break;
                        case 2:
                            if (findPointerIndex >= 0) {
                                this.ॱ.ˋ(motionEvent, this.ॱ.ᐝ, findPointerIndex);
                                this.ॱ.ˊ(sVar);
                                this.ॱ.ˏॱ.removeCallbacks(this.ॱ.ॱˊ);
                                this.ॱ.ॱˊ.run();
                                this.ॱ.ˏॱ.invalidate();
                                return;
                            }
                            return;
                        case 3:
                            if (this.ॱ.ͺ != null) {
                                this.ॱ.ͺ.clear();
                                break;
                            }
                            break;
                        case 6:
                            actionMasked = motionEvent.getActionIndex();
                            if (motionEvent.getPointerId(actionMasked) == this.ॱ.ʼ) {
                                if (actionMasked == 0) {
                                    i = 1;
                                }
                                this.ॱ.ʼ = motionEvent.getPointerId(i);
                                this.ॱ.ˋ(motionEvent, this.ॱ.ᐝ, actionMasked);
                                return;
                            }
                            return;
                        default:
                            return;
                    }
                    this.ॱ.ˋ(null, 0);
                    this.ॱ.ʼ = -1;
                }
            }
        }

        public void ˎ(boolean z) {
            if (z) {
                this.ॱ.ˋ(null, 0);
            }
        }
    };
    s ˋ = null;
    private androidx.recyclerview.widget.RecyclerView.e ˋˊ = null;
    View ˋॱ = null;
    final List<View> ˎ = new ArrayList();
    float ˏ;
    RecyclerView ˏॱ;
    VelocityTracker ͺ;
    float ॱ;
    final Runnable ॱˊ = new Runnable(this) {
        final /* synthetic */ mi ˎ;

        {
            this.ˎ = r1;
        }

        public void run() {
            if (this.ˎ.ˋ != null && this.ˎ.ॱ()) {
                if (this.ˎ.ˋ != null) {
                    this.ˎ.ˊ(this.ˎ.ˋ);
                }
                this.ˎ.ˏॱ.removeCallbacks(this.ˎ.ॱˊ);
                ViewCompat.ˏ(this.ˎ.ˏॱ, this);
            }
        }
    };
    private final float[] ॱˋ = new float[2];
    private float ॱˎ;
    List<a> ॱॱ = new ArrayList();
    hk ॱᐝ;
    int ᐝ;
    private float ᐝॱ;

    public static abstract class d {
        private static final Interpolator ˋ = new Interpolator() {
            public float getInterpolation(float f) {
                float f2 = f - 1.0f;
                return (f2 * (((f2 * f2) * f2) * f2)) + 1.0f;
            }
        };
        private static final Interpolator ˏ = new Interpolator() {
            public float getInterpolation(float f) {
                return (((f * f) * f) * f) * f;
            }
        };
        private int ˎ = -1;

        public abstract void ˊ(@NonNull s sVar, int i);

        public abstract boolean ˊ(@NonNull RecyclerView recyclerView, @NonNull s sVar, @NonNull s sVar2);

        public abstract int ˋ(@NonNull RecyclerView recyclerView, @NonNull s sVar);

        public static int ˎ(int i, int i2) {
            int i3 = i & 789516;
            if (i3 == 0) {
                return i;
            }
            int i4 = (i3 ^ -1) & i;
            if (i2 == 0) {
                return i4 | (i3 << 2);
            }
            return (i4 | ((i3 << 1) & -789517)) | (((i3 << 1) & 789516) << 2);
        }

        public static int ˋ(int i, int i2) {
            return (ˊ(0, i2 | i) | ˊ(1, i2)) | ˊ(2, i);
        }

        public static int ˊ(int i, int i2) {
            return i2 << (i * 8);
        }

        public int ˏ(int i, int i2) {
            int i3 = i & 3158064;
            if (i3 == 0) {
                return i;
            }
            int i4 = (i3 ^ -1) & i;
            if (i2 == 0) {
                return i4 | (i3 >> 2);
            }
            return (i4 | ((i3 >> 1) & -3158065)) | (((i3 >> 1) & 3158064) >> 2);
        }

        final int ˏ(RecyclerView recyclerView, s sVar) {
            return ˏ(ˋ(recyclerView, sVar), ViewCompat.ʼ(recyclerView));
        }

        boolean ˎ(RecyclerView recyclerView, s sVar) {
            return (ˏ(recyclerView, sVar) & 16711680) != 0;
        }

        public boolean ˏ(@NonNull RecyclerView recyclerView, @NonNull s sVar, @NonNull s sVar2) {
            return true;
        }

        public boolean ˎ() {
            return true;
        }

        public boolean ˊ() {
            return true;
        }

        public int ˏ() {
            return 0;
        }

        public float ॱ(@NonNull s sVar) {
            return 0.5f;
        }

        public float ˊ(@NonNull s sVar) {
            return 0.5f;
        }

        public float ॱ(float f) {
            return f;
        }

        public float ˎ(float f) {
            return f;
        }

        public s ˏ(@NonNull s sVar, @NonNull List<s> list, int i, int i2) {
            int width = i + sVar.ˊ.getWidth();
            int height = i2 + sVar.ˊ.getHeight();
            s sVar2 = null;
            int i3 = -1;
            int left = i - sVar.ˊ.getLeft();
            int top = i2 - sVar.ˊ.getTop();
            int size = list.size();
            int i4 = 0;
            while (i4 < size) {
                int i5;
                s sVar3;
                int i6;
                s sVar4;
                int i7;
                s sVar5 = (s) list.get(i4);
                if (left > 0) {
                    int right = sVar5.ˊ.getRight() - width;
                    if (right < 0 && sVar5.ˊ.getRight() > sVar.ˊ.getRight()) {
                        right = Math.abs(right);
                        if (right > i3) {
                            i5 = right;
                            sVar3 = sVar5;
                            if (left < 0) {
                                i3 = sVar5.ˊ.getLeft() - i;
                                if (i3 > 0 && sVar5.ˊ.getLeft() < sVar.ˊ.getLeft()) {
                                    i3 = Math.abs(i3);
                                    if (i3 > i5) {
                                        sVar3 = sVar5;
                                        if (top < 0) {
                                            i5 = sVar5.ˊ.getTop() - i2;
                                            if (i5 > 0 && sVar5.ˊ.getTop() < sVar.ˊ.getTop()) {
                                                i5 = Math.abs(i5);
                                                if (i5 > i3) {
                                                    sVar3 = sVar5;
                                                    if (top > 0) {
                                                        i3 = sVar5.ˊ.getBottom() - height;
                                                        if (i3 < 0 && sVar5.ˊ.getBottom() > sVar.ˊ.getBottom()) {
                                                            i3 = Math.abs(i3);
                                                            if (i3 > i5) {
                                                                i6 = i3;
                                                                sVar4 = sVar5;
                                                                i7 = i6;
                                                                i4++;
                                                                sVar2 = sVar4;
                                                                i3 = i7;
                                                            }
                                                        }
                                                    }
                                                    i7 = i5;
                                                    sVar4 = sVar3;
                                                    i4++;
                                                    sVar2 = sVar4;
                                                    i3 = i7;
                                                }
                                            }
                                        }
                                        i5 = i3;
                                        if (top > 0) {
                                            i3 = sVar5.ˊ.getBottom() - height;
                                            i3 = Math.abs(i3);
                                            if (i3 > i5) {
                                                i6 = i3;
                                                sVar4 = sVar5;
                                                i7 = i6;
                                                i4++;
                                                sVar2 = sVar4;
                                                i3 = i7;
                                            }
                                        }
                                        i7 = i5;
                                        sVar4 = sVar3;
                                        i4++;
                                        sVar2 = sVar4;
                                        i3 = i7;
                                    }
                                }
                            }
                            i3 = i5;
                            if (top < 0) {
                                i5 = sVar5.ˊ.getTop() - i2;
                                i5 = Math.abs(i5);
                                if (i5 > i3) {
                                    sVar3 = sVar5;
                                    if (top > 0) {
                                        i3 = sVar5.ˊ.getBottom() - height;
                                        i3 = Math.abs(i3);
                                        if (i3 > i5) {
                                            i6 = i3;
                                            sVar4 = sVar5;
                                            i7 = i6;
                                            i4++;
                                            sVar2 = sVar4;
                                            i3 = i7;
                                        }
                                    }
                                    i7 = i5;
                                    sVar4 = sVar3;
                                    i4++;
                                    sVar2 = sVar4;
                                    i3 = i7;
                                }
                            }
                            i5 = i3;
                            if (top > 0) {
                                i3 = sVar5.ˊ.getBottom() - height;
                                i3 = Math.abs(i3);
                                if (i3 > i5) {
                                    i6 = i3;
                                    sVar4 = sVar5;
                                    i7 = i6;
                                    i4++;
                                    sVar2 = sVar4;
                                    i3 = i7;
                                }
                            }
                            i7 = i5;
                            sVar4 = sVar3;
                            i4++;
                            sVar2 = sVar4;
                            i3 = i7;
                        }
                    }
                }
                sVar3 = sVar2;
                i5 = i3;
                if (left < 0) {
                    i3 = sVar5.ˊ.getLeft() - i;
                    i3 = Math.abs(i3);
                    if (i3 > i5) {
                        sVar3 = sVar5;
                        if (top < 0) {
                            i5 = sVar5.ˊ.getTop() - i2;
                            i5 = Math.abs(i5);
                            if (i5 > i3) {
                                sVar3 = sVar5;
                                if (top > 0) {
                                    i3 = sVar5.ˊ.getBottom() - height;
                                    i3 = Math.abs(i3);
                                    if (i3 > i5) {
                                        i6 = i3;
                                        sVar4 = sVar5;
                                        i7 = i6;
                                        i4++;
                                        sVar2 = sVar4;
                                        i3 = i7;
                                    }
                                }
                                i7 = i5;
                                sVar4 = sVar3;
                                i4++;
                                sVar2 = sVar4;
                                i3 = i7;
                            }
                        }
                        i5 = i3;
                        if (top > 0) {
                            i3 = sVar5.ˊ.getBottom() - height;
                            i3 = Math.abs(i3);
                            if (i3 > i5) {
                                i6 = i3;
                                sVar4 = sVar5;
                                i7 = i6;
                                i4++;
                                sVar2 = sVar4;
                                i3 = i7;
                            }
                        }
                        i7 = i5;
                        sVar4 = sVar3;
                        i4++;
                        sVar2 = sVar4;
                        i3 = i7;
                    }
                }
                i3 = i5;
                if (top < 0) {
                    i5 = sVar5.ˊ.getTop() - i2;
                    i5 = Math.abs(i5);
                    if (i5 > i3) {
                        sVar3 = sVar5;
                        if (top > 0) {
                            i3 = sVar5.ˊ.getBottom() - height;
                            i3 = Math.abs(i3);
                            if (i3 > i5) {
                                i6 = i3;
                                sVar4 = sVar5;
                                i7 = i6;
                                i4++;
                                sVar2 = sVar4;
                                i3 = i7;
                            }
                        }
                        i7 = i5;
                        sVar4 = sVar3;
                        i4++;
                        sVar2 = sVar4;
                        i3 = i7;
                    }
                }
                i5 = i3;
                if (top > 0) {
                    i3 = sVar5.ˊ.getBottom() - height;
                    i3 = Math.abs(i3);
                    if (i3 > i5) {
                        i6 = i3;
                        sVar4 = sVar5;
                        i7 = i6;
                        i4++;
                        sVar2 = sVar4;
                        i3 = i7;
                    }
                }
                i7 = i5;
                sVar4 = sVar3;
                i4++;
                sVar2 = sVar4;
                i3 = i7;
            }
            return sVar2;
        }

        public void ॱ(@Nullable s sVar, int i) {
            if (sVar != null) {
                mj.ˏ.ˎ(sVar.ˊ);
            }
        }

        private int ˏ(RecyclerView recyclerView) {
            if (this.ˎ == -1) {
                this.ˎ = recyclerView.getResources().getDimensionPixelSize(o.ly.a.ˋ);
            }
            return this.ˎ;
        }

        public void ˋ(@NonNull RecyclerView recyclerView, @NonNull s sVar, int i, @NonNull s sVar2, int i2, int i3, int i4) {
            j ʻ = recyclerView.ʻ();
            if (ʻ instanceof b) {
                ((b) ʻ).ˋ(sVar.ˊ, sVar2.ˊ, i3, i4);
                return;
            }
            if (ʻ.ʻ()) {
                if (ʻ.ʻ(sVar2.ˊ) <= recyclerView.getPaddingLeft()) {
                    recyclerView.ˏ(i2);
                }
                if (ʻ.ʽ(sVar2.ˊ) >= recyclerView.getWidth() - recyclerView.getPaddingRight()) {
                    recyclerView.ˏ(i2);
                }
            }
            if (ʻ.ʼ()) {
                if (ʻ.ʼ(sVar2.ˊ) <= recyclerView.getPaddingTop()) {
                    recyclerView.ˏ(i2);
                }
                if (ʻ.ˊॱ(sVar2.ˊ) >= recyclerView.getHeight() - recyclerView.getPaddingBottom()) {
                    recyclerView.ˏ(i2);
                }
            }
        }

        void ˊ(Canvas canvas, RecyclerView recyclerView, s sVar, List<a> list, int i, float f, float f2) {
            int i2;
            int size = list.size();
            for (i2 = 0; i2 < size; i2++) {
                a aVar = (a) list.get(i2);
                aVar.ˏ();
                int save = canvas.save();
                ˏ(canvas, recyclerView, aVar.ʼ, aVar.ˋॱ, aVar.ˏॱ, aVar.ॱॱ, false);
                canvas.restoreToCount(save);
            }
            if (sVar != null) {
                i2 = canvas.save();
                ˏ(canvas, recyclerView, sVar, f, f2, i, true);
                canvas.restoreToCount(i2);
            }
        }

        void ॱ(Canvas canvas, RecyclerView recyclerView, s sVar, List<a> list, int i, float f, float f2) {
            int i2;
            int size = list.size();
            for (i2 = 0; i2 < size; i2++) {
                a aVar = (a) list.get(i2);
                int save = canvas.save();
                ˋ(canvas, recyclerView, aVar.ʼ, aVar.ˋॱ, aVar.ˏॱ, aVar.ॱॱ, false);
                canvas.restoreToCount(save);
            }
            if (sVar != null) {
                i2 = canvas.save();
                ˋ(canvas, recyclerView, sVar, f, f2, i, true);
                canvas.restoreToCount(i2);
            }
            Object obj = null;
            int i3 = size - 1;
            while (i3 >= 0) {
                Object obj2;
                aVar = (a) list.get(i3);
                if (aVar.ˊॱ && !aVar.ॱˊ) {
                    list.remove(i3);
                    obj2 = obj;
                } else if (aVar.ˊॱ) {
                    obj2 = obj;
                } else {
                    obj2 = 1;
                }
                i3--;
                obj = obj2;
            }
            if (obj != null) {
                recyclerView.invalidate();
            }
        }

        public void ˊ(@NonNull RecyclerView recyclerView, @NonNull s sVar) {
            mj.ˏ.ˋ(sVar.ˊ);
        }

        public void ˏ(@NonNull Canvas canvas, @NonNull RecyclerView recyclerView, @NonNull s sVar, float f, float f2, int i, boolean z) {
            mj.ˏ.ˏ(canvas, recyclerView, sVar.ˊ, f, f2, i, z);
        }

        public void ˋ(@NonNull Canvas canvas, @NonNull RecyclerView recyclerView, s sVar, float f, float f2, int i, boolean z) {
            mj.ˏ.ˎ(canvas, recyclerView, sVar.ˊ, f, f2, i, z);
        }

        public long ॱ(@NonNull RecyclerView recyclerView, int i, float f, float f2) {
            ItemAnimator ʾ = recyclerView.ʾ();
            if (ʾ == null) {
                return i == 8 ? 200 : 250;
            } else {
                if (i == 8) {
                    return ʾ.ˎ();
                }
                return ʾ.ʼ();
            }
        }

        public int ˏ(@NonNull RecyclerView recyclerView, int i, int i2, int i3, long j) {
            float f = 1.0f;
            int ˏ = (int) (((float) (ˏ(recyclerView) * ((int) Math.signum((float) i2)))) * ˋ.getInterpolation(Math.min(1.0f, (((float) Math.abs(i2)) * 1.0f) / ((float) i))));
            if (j <= 2000) {
                f = ((float) j) / 2000.0f;
            }
            int interpolation = (int) (ˏ.getInterpolation(f) * ((float) ˏ));
            if (interpolation == 0) {
                return i2 > 0 ? 1 : -1;
            } else {
                return interpolation;
            }
        }
    }

    static class a implements AnimatorListener {
        final int ʻ;
        final s ʼ;
        final float ʽ;
        final float ˊ;
        boolean ˊॱ = false;
        final float ˋ;
        float ˋॱ;
        private final ValueAnimator ˎ;
        private float ˏ;
        float ˏॱ;
        boolean ͺ = false;
        boolean ॱˊ;
        final int ॱॱ;
        final float ᐝ;

        a(s sVar, int i, int i2, float f, float f2, float f3, float f4) {
            this.ॱॱ = i2;
            this.ʻ = i;
            this.ʼ = sVar;
            this.ˋ = f;
            this.ˊ = f2;
            this.ʽ = f3;
            this.ᐝ = f4;
            this.ˎ = ValueAnimator.ofFloat(new float[]{0.0f, 1.0f});
            this.ˎ.addUpdateListener(new AnimatorUpdateListener(this) {
                final /* synthetic */ a ॱ;

                {
                    this.ॱ = r1;
                }

                public void onAnimationUpdate(ValueAnimator valueAnimator) {
                    this.ॱ.ॱ(valueAnimator.getAnimatedFraction());
                }
            });
            this.ˎ.setTarget(sVar.ˊ);
            this.ˎ.addListener(this);
            ॱ(0.0f);
        }

        public void ˋ(long j) {
            this.ˎ.setDuration(j);
        }

        public void ˊ() {
            this.ʼ.ॱ(false);
            this.ˎ.start();
        }

        public void ˋ() {
            this.ˎ.cancel();
        }

        public void ॱ(float f) {
            this.ˏ = f;
        }

        public void ˏ() {
            if (this.ˋ == this.ʽ) {
                this.ˋॱ = this.ʼ.ˊ.getTranslationX();
            } else {
                this.ˋॱ = this.ˋ + (this.ˏ * (this.ʽ - this.ˋ));
            }
            if (this.ˊ == this.ᐝ) {
                this.ˏॱ = this.ʼ.ˊ.getTranslationY();
            } else {
                this.ˏॱ = this.ˊ + (this.ˏ * (this.ᐝ - this.ˊ));
            }
        }

        public void onAnimationStart(Animator animator) {
        }

        public void onAnimationEnd(Animator animator) {
            if (!this.ˊॱ) {
                this.ʼ.ॱ(true);
            }
            this.ˊॱ = true;
        }

        public void onAnimationCancel(Animator animator) {
            ॱ(1.0f);
        }

        public void onAnimationRepeat(Animator animator) {
        }
    }

    class e extends SimpleOnGestureListener {
        private boolean ˎ = true;
        final /* synthetic */ mi ॱ;

        e(mi miVar) {
            this.ॱ = miVar;
        }

        void ˎ() {
            this.ˎ = false;
        }

        public boolean onDown(MotionEvent motionEvent) {
            return true;
        }

        public void onLongPress(MotionEvent motionEvent) {
            if (this.ˎ) {
                View ˋ = this.ॱ.ˋ(motionEvent);
                if (ˋ != null) {
                    s ॱ = this.ॱ.ˏॱ.ॱ(ˋ);
                    if (ॱ != null && this.ॱ.ʻ.ˎ(this.ॱ.ˏॱ, ॱ) && motionEvent.getPointerId(0) == this.ॱ.ʼ) {
                        int findPointerIndex = motionEvent.findPointerIndex(this.ॱ.ʼ);
                        float x = motionEvent.getX(findPointerIndex);
                        float y = motionEvent.getY(findPointerIndex);
                        this.ॱ.ˊ = x;
                        this.ॱ.ˏ = y;
                        mi miVar = this.ॱ;
                        this.ॱ.ʽ = 0.0f;
                        miVar.ॱ = 0.0f;
                        if (this.ॱ.ʻ.ˎ()) {
                            this.ॱ.ˋ(ॱ, 2);
                        }
                    }
                }
            }
        }
    }

    public mi(@NonNull d dVar) {
        this.ʻ = dVar;
    }

    private static boolean ˏ(View view, float f, float f2, float f3, float f4) {
        return f >= f3 && f <= ((float) view.getWidth()) + f3 && f2 >= f4 && f2 <= ((float) view.getHeight()) + f4;
    }

    public void ˏ(@Nullable RecyclerView recyclerView) {
        if (this.ˏॱ != recyclerView) {
            if (this.ˏॱ != null) {
                ˊ();
            }
            this.ˏॱ = recyclerView;
            if (recyclerView != null) {
                Resources resources = recyclerView.getResources();
                this.ᐝॱ = resources.getDimension(o.ly.a.ॱॱ);
                this.ॱˎ = resources.getDimension(o.ly.a.ˎ);
                ˋ();
            }
        }
    }

    private void ˋ() {
        this.ʿ = ViewConfiguration.get(this.ˏॱ.getContext()).getScaledTouchSlop();
        this.ˏॱ.ॱ(this);
        this.ˏॱ.ˏ(this.ˊᐝ);
        this.ˏॱ.ˏ(this);
        ʽ();
    }

    private void ˊ() {
        this.ˏॱ.ˏ(this);
        this.ˏॱ.ॱ(this.ˊᐝ);
        this.ˏॱ.ˎ(this);
        for (int size = this.ॱॱ.size() - 1; size >= 0; size--) {
            this.ʻ.ˊ(this.ˏॱ, ((a) this.ॱॱ.get(0)).ʼ);
        }
        this.ॱॱ.clear();
        this.ˋॱ = null;
        this.ˊॱ = -1;
        ॱॱ();
        ʻ();
    }

    private void ʽ() {
        this.ˊˊ = new e(this);
        this.ॱᐝ = new hk(this.ˏॱ.getContext(), this.ˊˊ);
    }

    private void ʻ() {
        if (this.ˊˊ != null) {
            this.ˊˊ.ˎ();
            this.ˊˊ = null;
        }
        if (this.ॱᐝ != null) {
            this.ॱᐝ = null;
        }
    }

    private void ˎ(float[] fArr) {
        if ((this.ᐝ & 12) != 0) {
            fArr[0] = (this.ʻॱ + this.ॱ) - ((float) this.ˋ.ˊ.getLeft());
        } else {
            fArr[0] = this.ˋ.ˊ.getTranslationX();
        }
        if ((this.ᐝ & 3) != 0) {
            fArr[1] = (this.ʾ + this.ʽ) - ((float) this.ˋ.ˊ.getTop());
        } else {
            fArr[1] = this.ˋ.ˊ.getTranslationY();
        }
    }

    public void ˋ(Canvas canvas, RecyclerView recyclerView, t tVar) {
        float f;
        float f2 = 0.0f;
        if (this.ˋ != null) {
            ˎ(this.ॱˋ);
            f = this.ॱˋ[0];
            f2 = this.ॱˋ[1];
        } else {
            f = 0.0f;
        }
        this.ʻ.ॱ(canvas, recyclerView, this.ˋ, this.ॱॱ, this.ˈ, f, f2);
    }

    public void ˊ(Canvas canvas, RecyclerView recyclerView, t tVar) {
        float f;
        float f2 = 0.0f;
        this.ˊॱ = -1;
        if (this.ˋ != null) {
            ˎ(this.ॱˋ);
            f = this.ॱˋ[0];
            f2 = this.ॱˋ[1];
        } else {
            f = 0.0f;
        }
        this.ʻ.ˊ(canvas, recyclerView, this.ˋ, this.ॱॱ, this.ˈ, f, f2);
    }

    void ˋ(@Nullable s sVar, int i) {
        if (sVar != this.ˋ || i != this.ˈ) {
            this.ˉ = Long.MIN_VALUE;
            int i2 = this.ˈ;
            ˋ(sVar, true);
            this.ˈ = i;
            if (i == 2) {
                if (sVar == null) {
                    throw new IllegalArgumentException("Must pass a ViewHolder when dragging");
                }
                this.ˋॱ = sVar.ˊ;
                ᐝ();
            }
            int i3 = (1 << ((i * 8) + 8)) - 1;
            Object obj = null;
            if (this.ˋ != null) {
                s sVar2 = this.ˋ;
                if (sVar2.ˊ.getParent() != null) {
                    int i4;
                    float f;
                    float signum;
                    int i5;
                    if (i2 == 2) {
                        i4 = 0;
                    } else {
                        i4 = ˎ(sVar2);
                    }
                    ॱॱ();
                    switch (i4) {
                        case 1:
                        case 2:
                            f = 0.0f;
                            signum = Math.signum(this.ʽ) * ((float) this.ˏॱ.getHeight());
                            break;
                        case 4:
                        case 8:
                        case 16:
                        case 32:
                            signum = 0.0f;
                            f = Math.signum(this.ॱ) * ((float) this.ˏॱ.getWidth());
                            break;
                        default:
                            f = 0.0f;
                            signum = 0.0f;
                            break;
                    }
                    if (i2 == 2) {
                        i5 = 8;
                    } else if (i4 > 0) {
                        i5 = 2;
                    } else {
                        i5 = 4;
                    }
                    ˎ(this.ॱˋ);
                    float f2 = this.ॱˋ[0];
                    float f3 = this.ॱˋ[1];
                    final s sVar3 = sVar2;
                    a anonymousClass5 = new a(this, sVar2, i5, i2, f2, f3, f, signum) {
                        final /* synthetic */ mi ˎ;

                        public void onAnimationEnd(Animator animator) {
                            super.onAnimationEnd(animator);
                            if (!this.ͺ) {
                                if (i4 <= 0) {
                                    this.ˎ.ʻ.ˊ(this.ˎ.ˏॱ, sVar3);
                                } else {
                                    this.ˎ.ˎ.add(sVar3.ˊ);
                                    this.ॱˊ = true;
                                    if (i4 > 0) {
                                        this.ˎ.ˏ((a) this, i4);
                                    }
                                }
                                if (this.ˎ.ˋॱ == sVar3.ˊ) {
                                    this.ˎ.ˏ(sVar3.ˊ);
                                }
                            }
                        }
                    };
                    anonymousClass5.ˋ(this.ʻ.ॱ(this.ˏॱ, i5, f - f2, signum - f3));
                    this.ॱॱ.add(anonymousClass5);
                    anonymousClass5.ˊ();
                    obj = 1;
                } else {
                    ˏ(sVar2.ˊ);
                    this.ʻ.ˊ(this.ˏॱ, sVar2);
                }
                this.ˋ = null;
            }
            Object obj2 = obj;
            if (sVar != null) {
                this.ᐝ = (this.ʻ.ˏ(this.ˏॱ, sVar) & i3) >> (this.ˈ * 8);
                this.ʻॱ = (float) sVar.ˊ.getLeft();
                this.ʾ = (float) sVar.ˊ.getTop();
                this.ˋ = sVar;
                if (i == 2) {
                    this.ˋ.ˊ.performHapticFeedback(0);
                }
            }
            ViewParent parent = this.ˏॱ.getParent();
            if (parent != null) {
                parent.requestDisallowInterceptTouchEvent(this.ˋ != null);
            }
            if (obj2 == null) {
                this.ˏॱ.ʻ().ˑ();
            }
            this.ʻ.ॱ(this.ˋ, this.ˈ);
            this.ˏॱ.invalidate();
        }
    }

    void ˏ(final a aVar, final int i) {
        this.ˏॱ.post(new Runnable(this) {
            final /* synthetic */ mi ˊ;

            public void run() {
                if (this.ˊ.ˏॱ != null && this.ˊ.ˏॱ.isAttachedToWindow() && !aVar.ͺ && aVar.ʼ.ˋ() != -1) {
                    ItemAnimator ʾ = this.ˊ.ˏॱ.ʾ();
                    if ((ʾ == null || !ʾ.ॱ(null)) && !this.ˊ.ˏ()) {
                        this.ˊ.ʻ.ˊ(aVar.ʼ, i);
                    } else {
                        this.ˊ.ˏॱ.post(this);
                    }
                }
            }
        });
    }

    boolean ˏ() {
        int size = this.ॱॱ.size();
        for (int i = 0; i < size; i++) {
            if (!((a) this.ॱॱ.get(i)).ˊॱ) {
                return true;
            }
        }
        return false;
    }

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    boolean ॱ() {
        /*
        r14 = this;
        r12 = -9223372036854775808;
        r5 = 0;
        r0 = 0;
        r1 = r14.ˋ;
        if (r1 != 0) goto L_0x000b;
    L_0x0008:
        r14.ˉ = r12;
    L_0x000a:
        return r0;
    L_0x000b:
        r10 = java.lang.System.currentTimeMillis();
        r2 = r14.ˉ;
        r1 = (r2 > r12 ? 1 : (r2 == r12 ? 0 : -1));
        if (r1 != 0) goto L_0x00bb;
    L_0x0015:
        r6 = 0;
    L_0x0017:
        r1 = r14.ˏॱ;
        r1 = r1.ʻ();
        r2 = r14.ˊˋ;
        if (r2 != 0) goto L_0x0028;
    L_0x0021:
        r2 = new android.graphics.Rect;
        r2.<init>();
        r14.ˊˋ = r2;
    L_0x0028:
        r2 = r14.ˋ;
        r2 = r2.ˊ;
        r3 = r14.ˊˋ;
        r1.ˊ(r2, r3);
        r2 = r1.ʻ();
        if (r2 == 0) goto L_0x00e6;
    L_0x0037:
        r2 = r14.ʻॱ;
        r3 = r14.ॱ;
        r2 = r2 + r3;
        r2 = (int) r2;
        r3 = r14.ˊˋ;
        r3 = r3.left;
        r3 = r2 - r3;
        r4 = r14.ˏॱ;
        r4 = r4.getPaddingLeft();
        r4 = r3 - r4;
        r3 = r14.ॱ;
        r3 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1));
        if (r3 >= 0) goto L_0x00c1;
    L_0x0051:
        if (r4 >= 0) goto L_0x00c1;
    L_0x0053:
        r1 = r1.ʼ();
        if (r1 == 0) goto L_0x010e;
    L_0x0059:
        r1 = r14.ʾ;
        r2 = r14.ʽ;
        r1 = r1 + r2;
        r1 = (int) r1;
        r2 = r14.ˊˋ;
        r2 = r2.top;
        r2 = r1 - r2;
        r3 = r14.ˏॱ;
        r3 = r3.getPaddingTop();
        r8 = r2 - r3;
        r2 = r14.ʽ;
        r2 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1));
        if (r2 >= 0) goto L_0x00e9;
    L_0x0073:
        if (r8 >= 0) goto L_0x00e9;
    L_0x0075:
        if (r4 == 0) goto L_0x0117;
    L_0x0077:
        r1 = r14.ʻ;
        r2 = r14.ˏॱ;
        r3 = r14.ˋ;
        r3 = r3.ˊ;
        r3 = r3.getWidth();
        r5 = r14.ˏॱ;
        r5 = r5.getWidth();
        r4 = r1.ˏ(r2, r3, r4, r5, r6);
        r9 = r4;
    L_0x008e:
        if (r8 == 0) goto L_0x0115;
    L_0x0090:
        r1 = r14.ʻ;
        r2 = r14.ˏॱ;
        r3 = r14.ˋ;
        r3 = r3.ˊ;
        r3 = r3.getHeight();
        r4 = r14.ˏॱ;
        r5 = r4.getHeight();
        r4 = r8;
        r1 = r1.ˏ(r2, r3, r4, r5, r6);
    L_0x00a7:
        if (r9 != 0) goto L_0x00ab;
    L_0x00a9:
        if (r1 == 0) goto L_0x0111;
    L_0x00ab:
        r2 = r14.ˉ;
        r0 = (r2 > r12 ? 1 : (r2 == r12 ? 0 : -1));
        if (r0 != 0) goto L_0x00b3;
    L_0x00b1:
        r14.ˉ = r10;
    L_0x00b3:
        r0 = r14.ˏॱ;
        r0.scrollBy(r9, r1);
        r0 = 1;
        goto L_0x000a;
    L_0x00bb:
        r2 = r14.ˉ;
        r6 = r10 - r2;
        goto L_0x0017;
    L_0x00c1:
        r3 = r14.ॱ;
        r3 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1));
        if (r3 <= 0) goto L_0x00e6;
    L_0x00c7:
        r3 = r14.ˋ;
        r3 = r3.ˊ;
        r3 = r3.getWidth();
        r2 = r2 + r3;
        r3 = r14.ˊˋ;
        r3 = r3.right;
        r2 = r2 + r3;
        r3 = r14.ˏॱ;
        r3 = r3.getWidth();
        r4 = r14.ˏॱ;
        r4 = r4.getPaddingRight();
        r3 = r3 - r4;
        r4 = r2 - r3;
        if (r4 > 0) goto L_0x0053;
    L_0x00e6:
        r4 = r0;
        goto L_0x0053;
    L_0x00e9:
        r2 = r14.ʽ;
        r2 = (r2 > r5 ? 1 : (r2 == r5 ? 0 : -1));
        if (r2 <= 0) goto L_0x010e;
    L_0x00ef:
        r2 = r14.ˋ;
        r2 = r2.ˊ;
        r2 = r2.getHeight();
        r1 = r1 + r2;
        r2 = r14.ˊˋ;
        r2 = r2.bottom;
        r1 = r1 + r2;
        r2 = r14.ˏॱ;
        r2 = r2.getHeight();
        r3 = r14.ˏॱ;
        r3 = r3.getPaddingBottom();
        r2 = r2 - r3;
        r8 = r1 - r2;
        if (r8 > 0) goto L_0x0075;
    L_0x010e:
        r8 = r0;
        goto L_0x0075;
    L_0x0111:
        r14.ˉ = r12;
        goto L_0x000a;
    L_0x0115:
        r1 = r8;
        goto L_0x00a7;
    L_0x0117:
        r9 = r4;
        goto L_0x008e;
        */
        throw new UnsupportedOperationException("Method not decompiled: o.mi.ॱ():boolean");
    }

    private List<s> ˋ(s sVar) {
        if (this.ʼॱ == null) {
            this.ʼॱ = new ArrayList();
            this.ʽॱ = new ArrayList();
        } else {
            this.ʼॱ.clear();
            this.ʽॱ.clear();
        }
        int ˏ = this.ʻ.ˏ();
        int round = Math.round(this.ʻॱ + this.ॱ) - ˏ;
        int round2 = Math.round(this.ʾ + this.ʽ) - ˏ;
        int width = (sVar.ˊ.getWidth() + round) + (ˏ * 2);
        int height = (sVar.ˊ.getHeight() + round2) + (ˏ * 2);
        int i = (round + width) / 2;
        int i2 = (round2 + height) / 2;
        j ʻ = this.ˏॱ.ʻ();
        int ˈ = ʻ.ˈ();
        for (int i3 = 0; i3 < ˈ; i3++) {
            View ᐝ = ʻ.ᐝ(i3);
            if (ᐝ != sVar.ˊ && ᐝ.getBottom() >= round2 && ᐝ.getTop() <= height && ᐝ.getRight() >= round && ᐝ.getLeft() <= width) {
                s ॱ = this.ˏॱ.ॱ(ᐝ);
                if (this.ʻ.ˏ(this.ˏॱ, this.ˋ, ॱ)) {
                    int abs = Math.abs(i - ((ᐝ.getLeft() + ᐝ.getRight()) / 2));
                    ˏ = Math.abs(i2 - ((ᐝ.getBottom() + ᐝ.getTop()) / 2));
                    int i4 = (abs * abs) + (ˏ * ˏ);
                    int size = this.ʼॱ.size();
                    int i5 = 0;
                    abs = 0;
                    while (abs < size && i4 > ((Integer) this.ʽॱ.get(abs)).intValue()) {
                        i5++;
                        abs++;
                    }
                    this.ʼॱ.add(i5, ॱ);
                    this.ʽॱ.add(i5, Integer.valueOf(i4));
                }
            }
        }
        return this.ʼॱ;
    }

    void ˊ(s sVar) {
        if (!this.ˏॱ.isLayoutRequested() && this.ˈ == 2) {
            float ˊ = this.ʻ.ˊ(sVar);
            int i = (int) (this.ʻॱ + this.ॱ);
            int i2 = (int) (this.ʾ + this.ʽ);
            if (((float) Math.abs(i2 - sVar.ˊ.getTop())) >= ((float) sVar.ˊ.getHeight()) * ˊ || ((float) Math.abs(i - sVar.ˊ.getLeft())) >= ˊ * ((float) sVar.ˊ.getWidth())) {
                List ˋ = ˋ(sVar);
                if (ˋ.size() != 0) {
                    s ˏ = this.ʻ.ˏ(sVar, ˋ, i, i2);
                    if (ˏ == null) {
                        this.ʼॱ.clear();
                        this.ʽॱ.clear();
                        return;
                    }
                    int ˋ2 = ˏ.ˋ();
                    int ˋ3 = sVar.ˋ();
                    if (this.ʻ.ˊ(this.ˏॱ, sVar, ˏ)) {
                        this.ʻ.ˋ(this.ˏॱ, sVar, ˋ3, ˏ, ˋ2, i, i2);
                    }
                }
            }
        }
    }

    public void ˎ(@NonNull View view) {
    }

    public void ˋ(@NonNull View view) {
        ˏ(view);
        s ॱ = this.ˏॱ.ॱ(view);
        if (ॱ != null) {
            if (this.ˋ == null || ॱ != this.ˋ) {
                ˋ(ॱ, false);
                if (this.ˎ.remove(ॱ.ˊ)) {
                    this.ʻ.ˊ(this.ˏॱ, ॱ);
                    return;
                }
                return;
            }
            ˋ(null, 0);
        }
    }

    void ˋ(s sVar, boolean z) {
        for (int size = this.ॱॱ.size() - 1; size >= 0; size--) {
            a aVar = (a) this.ॱॱ.get(size);
            if (aVar.ʼ == sVar) {
                aVar.ͺ |= z;
                if (!aVar.ˊॱ) {
                    aVar.ˋ();
                }
                this.ॱॱ.remove(size);
                return;
            }
        }
    }

    public void ˏ(Rect rect, View view, RecyclerView recyclerView, t tVar) {
        rect.setEmpty();
    }

    void ˎ() {
        if (this.ͺ != null) {
            this.ͺ.recycle();
        }
        this.ͺ = VelocityTracker.obtain();
    }

    private void ॱॱ() {
        if (this.ͺ != null) {
            this.ͺ.recycle();
            this.ͺ = null;
        }
    }

    private s ˊ(MotionEvent motionEvent) {
        j ʻ = this.ˏॱ.ʻ();
        if (this.ʼ == -1) {
            return null;
        }
        int findPointerIndex = motionEvent.findPointerIndex(this.ʼ);
        float x = motionEvent.getX(findPointerIndex) - this.ˊ;
        float y = motionEvent.getY(findPointerIndex) - this.ˏ;
        x = Math.abs(x);
        y = Math.abs(y);
        if (x < ((float) this.ʿ) && y < ((float) this.ʿ)) {
            return null;
        }
        if (x > y && ʻ.ʻ()) {
            return null;
        }
        if (y > x && ʻ.ʼ()) {
            return null;
        }
        View ˋ = ˋ(motionEvent);
        if (ˋ != null) {
            return this.ˏॱ.ॱ(ˋ);
        }
        return null;
    }

    void ˎ(int i, MotionEvent motionEvent, int i2) {
        if (this.ˋ == null && i == 2 && this.ˈ != 2 && this.ʻ.ˊ() && this.ˏॱ.ʽ() != 1) {
            s ˊ = ˊ(motionEvent);
            if (ˊ != null) {
                int ˏ = (this.ʻ.ˏ(this.ˏॱ, ˊ) & 65280) >> 8;
                if (ˏ != 0) {
                    float x = motionEvent.getX(i2);
                    x -= this.ˊ;
                    float y = motionEvent.getY(i2) - this.ˏ;
                    float abs = Math.abs(x);
                    float abs2 = Math.abs(y);
                    if (abs >= ((float) this.ʿ) || abs2 >= ((float) this.ʿ)) {
                        if (abs > abs2) {
                            if (x < 0.0f && (ˏ & 4) == 0) {
                                return;
                            }
                            if (x > 0.0f && (ˏ & 8) == 0) {
                                return;
                            }
                        } else if (y < 0.0f && (ˏ & 1) == 0) {
                            return;
                        } else {
                            if (y > 0.0f && (ˏ & 2) == 0) {
                                return;
                            }
                        }
                        this.ʽ = 0.0f;
                        this.ॱ = 0.0f;
                        this.ʼ = motionEvent.getPointerId(0);
                        ˋ(ˊ, 1);
                    }
                }
            }
        }
    }

    View ˋ(MotionEvent motionEvent) {
        float x = motionEvent.getX();
        float y = motionEvent.getY();
        if (this.ˋ != null) {
            View view = this.ˋ.ˊ;
            if (ˏ(view, x, y, this.ʻॱ + this.ॱ, this.ʾ + this.ʽ)) {
                return view;
            }
        }
        for (int size = this.ॱॱ.size() - 1; size >= 0; size--) {
            a aVar = (a) this.ॱॱ.get(size);
            View view2 = aVar.ʼ.ˊ;
            if (ˏ(view2, x, y, aVar.ˋॱ, aVar.ˏॱ)) {
                return view2;
            }
        }
        return this.ˏॱ.ˋ(x, y);
    }

    public void ˏ(@NonNull s sVar) {
        if (!this.ʻ.ˎ(this.ˏॱ, sVar)) {
            Log.e("ItemTouchHelper", "Start drag has been called but dragging is not enabled");
        } else if (sVar.ˊ.getParent() != this.ˏॱ) {
            Log.e("ItemTouchHelper", "Start drag has been called with a view holder which is not a child of the RecyclerView which is controlled by this ItemTouchHelper.");
        } else {
            ˎ();
            this.ʽ = 0.0f;
            this.ॱ = 0.0f;
            ˋ(sVar, 2);
        }
    }

    a ˏ(MotionEvent motionEvent) {
        if (this.ॱॱ.isEmpty()) {
            return null;
        }
        View ˋ = ˋ(motionEvent);
        for (int size = this.ॱॱ.size() - 1; size >= 0; size--) {
            a aVar = (a) this.ॱॱ.get(size);
            if (aVar.ʼ.ˊ == ˋ) {
                return aVar;
            }
        }
        return null;
    }

    void ˋ(MotionEvent motionEvent, int i, int i2) {
        float x = motionEvent.getX(i2);
        float y = motionEvent.getY(i2);
        this.ॱ = x - this.ˊ;
        this.ʽ = y - this.ˏ;
        if ((i & 4) == 0) {
            this.ॱ = Math.max(0.0f, this.ॱ);
        }
        if ((i & 8) == 0) {
            this.ॱ = Math.min(0.0f, this.ॱ);
        }
        if ((i & 1) == 0) {
            this.ʽ = Math.max(0.0f, this.ʽ);
        }
        if ((i & 2) == 0) {
            this.ʽ = Math.min(0.0f, this.ʽ);
        }
    }

    private int ˎ(s sVar) {
        if (this.ˈ == 2) {
            return 0;
        }
        int ˋ = this.ʻ.ˋ(this.ˏॱ, sVar);
        int ˏ = (this.ʻ.ˏ(ˋ, ViewCompat.ʼ(this.ˏॱ)) & 65280) >> 8;
        if (ˏ == 0) {
            return 0;
        }
        int i = (ˋ & 65280) >> 8;
        if (Math.abs(this.ॱ) > Math.abs(this.ʽ)) {
            ˋ = ˎ(sVar, ˏ);
            if (ˋ > 0) {
                return (i & ˋ) == 0 ? d.ˎ(ˋ, ViewCompat.ʼ(this.ˏॱ)) : ˋ;
            } else {
                ˋ = ˏ(sVar, ˏ);
                if (ˋ > 0) {
                    return ˋ;
                }
                return 0;
            }
        }
        ˋ = ˏ(sVar, ˏ);
        if (ˋ > 0) {
            return ˋ;
        }
        ˋ = ˎ(sVar, ˏ);
        if (ˋ > 0) {
            return (i & ˋ) == 0 ? d.ˎ(ˋ, ViewCompat.ʼ(this.ˏॱ)) : ˋ;
        } else {
            return 0;
        }
    }

    private int ˎ(s sVar, int i) {
        int i2 = 8;
        if ((i & 12) != 0) {
            int i3 = this.ॱ > 0.0f ? 8 : 4;
            if (this.ͺ != null && this.ʼ > -1) {
                this.ͺ.computeCurrentVelocity(1000, this.ʻ.ˎ(this.ॱˎ));
                float xVelocity = this.ͺ.getXVelocity(this.ʼ);
                float yVelocity = this.ͺ.getYVelocity(this.ʼ);
                if (xVelocity <= 0.0f) {
                    i2 = 4;
                }
                float abs = Math.abs(xVelocity);
                if ((i2 & i) != 0 && i3 == i2 && abs >= this.ʻ.ॱ(this.ᐝॱ) && abs > Math.abs(yVelocity)) {
                    return i2;
                }
            }
            float width = ((float) this.ˏॱ.getWidth()) * this.ʻ.ॱ(sVar);
            if ((i & i3) != 0 && Math.abs(this.ॱ) > width) {
                return i3;
            }
        }
        return 0;
    }

    private int ˏ(s sVar, int i) {
        int i2 = 2;
        if ((i & 3) != 0) {
            int i3 = this.ʽ > 0.0f ? 2 : 1;
            if (this.ͺ != null && this.ʼ > -1) {
                this.ͺ.computeCurrentVelocity(1000, this.ʻ.ˎ(this.ॱˎ));
                float xVelocity = this.ͺ.getXVelocity(this.ʼ);
                float yVelocity = this.ͺ.getYVelocity(this.ʼ);
                if (yVelocity <= 0.0f) {
                    i2 = 1;
                }
                float abs = Math.abs(yVelocity);
                if ((i2 & i) != 0 && i2 == i3 && abs >= this.ʻ.ॱ(this.ᐝॱ) && abs > Math.abs(xVelocity)) {
                    return i2;
                }
            }
            float height = ((float) this.ˏॱ.getHeight()) * this.ʻ.ॱ(sVar);
            if ((i & i3) != 0 && Math.abs(this.ʽ) > height) {
                return i3;
            }
        }
        return 0;
    }

    private void ᐝ() {
        if (VERSION.SDK_INT < 21) {
            if (this.ˋˊ == null) {
                this.ˋˊ = new androidx.recyclerview.widget.RecyclerView.e(this) {
                    final /* synthetic */ mi ˊ;

                    {
                        this.ˊ = r1;
                    }

                    public int ॱ(int i, int i2) {
                        if (this.ˊ.ˋॱ == null) {
                            return i2;
                        }
                        int i3 = this.ˊ.ˊॱ;
                        if (i3 == -1) {
                            i3 = this.ˊ.ˏॱ.indexOfChild(this.ˊ.ˋॱ);
                            this.ˊ.ˊॱ = i3;
                        }
                        if (i2 == i - 1) {
                            return i3;
                        }
                        return i2 >= i3 ? i2 + 1 : i2;
                    }
                };
            }
            this.ˏॱ.setChildDrawingOrderCallback(this.ˋˊ);
        }
    }

    void ˏ(View view) {
        if (view == this.ˋॱ) {
            this.ˋॱ = null;
            if (this.ˋˊ != null) {
                this.ˏॱ.setChildDrawingOrderCallback(null);
            }
        }
    }
}
